import QtQuick 2.0
import "../../js/UI.js" as Style

Item {
    id: m_ButtonBar_id
    property alias m_text: m_text_id.text
    property alias m_source: m_Img_id.source
    property alias m_color: m_text_id.color
    property  alias deVisible: deletimg.visible;
    property alias m_backdrop: backdroprect
    signal  clickSignal(var name )
    signal  deletimgsignal()

    Column{
        id: rect_img
        spacing: m_lineValue*0.3
        width: childrenRect.width
        height: childrenRect.height
        Rectangle {
            color:name=="" ? "#ffffff" : "#cccccc"
            id:backdroprect
            radius: 0.2*parent.height
            height: width
            width: m_lineValue*1.15
            Image {
                id: m_Img_id
                height: m_lineValue*1.15*0.5;
                width: height
                anchors.centerIn: parent;
            }
            Image {
                id: deletimg
                anchors.left: parent.left
                anchors.leftMargin: parent.width-0.3*m_lineValue
                anchors.bottom: parent.bottom
                anchors.bottomMargin: parent.height-0.3*m_lineValue
                width: m_lineValue*0.4
                height: m_lineValue*0.4
                source: "qrc:/images/new_delete5.svg"
                MouseArea{
                    anchors.fill: parent
                    enabled: deletimg.visible&&m_text != ""
                    onClicked: {
                        clickSignal(name)
                    }

                }
            }
            //            MouseArea {
            //                id: mouse_font
            //                enabled : !m_deskapp
            //                anchors.fill: parent
            //                onPressAndHold: {
            //                    m_deskapp = true
            //                    isapear = true

            //                }
            //                onClicked: {
            //                    m_deskapp = true
            //                    isapear = true
            //                }
            //            }
        }
        Item {
            height: 20
            width: backdroprect.width
            visible: backdroprect.width==m_lineValue*1.15
            AText {
                id: m_text_id
                font.pointSize: 11
                anchors.centerIn: parent;
            }
        }
    }

}




